/*
 * CoreSettings.h
 *
 *  Created on: Dec 12, 2014
 *      Authors: Avihay Avitan & Stefan Farcas
 */

#ifndef CORESETTINGS_H_
#define CORESETTINGS_H_
#include "../INIReader/INIReader.h"
#include <string>
#include <stdlib.h>

using namespace std ;

namespace SettingsSpace {

/**
 * CoreSettings - a class that provides the mechanism to get the values of the settings from the configuration file core.ini
 * Each configuration is in the format of section and attributes.
 */
class CoreSettings
{
    public:
        static CoreSettings& getInstance()
        {
            static CoreSettings    instance; // Guaranteed to be destroyed.
                                  // Instantiated on first use.
            return instance;
        }

        //Prediction Module
    	bool isPredictionFromStub();
    	string getPredictionTextFilePath();
    	bool isPredictionFromTextFile();
    	int getPredictionOffsetFromNow();
    	int getPredictionAccessInterval();
    	int getDurationLowerLimit();
    	int getDurationUpperLimit();
    	int getStartPassInterval();

    	//Commands module
    	bool isCommandsFromStub();
    	string getCommandsTextFilePath();
    	bool isCommandsFromTextFile();
    	int getNumOfCommandsPerSat();

    	//Antennas controllers module
    	bool isAntennasFromSTUB();

    	//Core
    	int getCoreFailureTime();
    	int getDiffForSleeping();
    	int getIntervalSecBeforePass();
    	int getTimeOutSec();
		bool isCoreInSimulatorMode();
		long getCoreSimulatorMicroseconds();
		int getTimeoutStage();

    	//ZMQ
    	bool isZMQEnabled();
    	string getZMQHost();
    	int getZMQPort();

    	//Logger
    	bool isColorTextSupported();
    	string getGSLogFilePath();
    	string getPassLogDirPath();

    	//Status Publisher
    	bool isPublishStatus();
    	int getPublisherPort();

    	//Tracker
    	int getAntennasRate();

    	//Satellite Stub
    	string getStubLogFile();
    	int getnumOfStatushData();
    	int getnumOfHealthData();
    	int getnumOfCommandsFailues();
    	int getnumOfINITFailures();

    	//ZMQ
    	string getClientExcpLogFile();
    	string getServerExcpLogFile();

    private:
        CoreSettings();
        CoreSettings(CoreSettings const&);
        void operator=(CoreSettings const&);
        INIReader * reader;
        int predictionFileNum;
        int predictionFilesLoaded;
        int commandsFileNum;
        int commandsFilesLoaded;
};

} /* namespace SettingsSpace */

#endif /* CORESETTINGS_H_ */
